let WebSocketServer = require('ws');


// const ws =

let ws = new WebSocketServer.Server({
  port: 8022
});

//connection : 已经建立连接
ws.on('connection', (client) => {
  // console.log("有客到~~", client);

  client.on('message',(msg)=>{
    console.log(msg);
    client.send(JSON.stringify({msg: '你也好啊'}))
  });

});

